package com.itboye.jinpuyiyuan.responsitory;

import com.google.gson.reflect.TypeToken;
import com.itboye.jinpuyiyuan.bean.ALIInfoBean;
import com.itboye.jinpuyiyuan.bean.ArticleDetailBean;
import com.itboye.jinpuyiyuan.bean.ArticleListBean;
import com.itboye.jinpuyiyuan.bean.BannerBean;
import com.itboye.jinpuyiyuan.bean.BranchBean;
import com.itboye.jinpuyiyuan.bean.BranchDepartmentBean;
import com.itboye.jinpuyiyuan.bean.ConfigBean;
import com.itboye.jinpuyiyuan.bean.IllTagBean;
import com.itboye.jinpuyiyuan.bean.NoticeBean;
import com.itboye.jinpuyiyuan.bean.OnlineBean;
import com.itboye.jinpuyiyuan.bean.PersonBean;
import com.itboye.jinpuyiyuan.bean.QueryDoctorListBean;
import com.itboye.jinpuyiyuan.bean.RegisterDoctorDetail;
import com.itboye.jinpuyiyuan.bean.UserInfoBean;
import com.itboye.jinpuyiyuan.bean.VipBean;
import com.itboye.jinpuyiyuan.bean.WXBean;
import com.itboye.jinpuyiyuan.interfaces.ISelectBranch;
import com.itboye.jinpuyiyuan.utils.volley.BaseErrorListener;
import com.itboye.jinpuyiyuan.utils.volley.BaseNetRepository;
import com.itboye.jinpuyiyuan.utils.volley.BaseSuccessReqListener;
import com.itboye.jinpuyiyuan.utils.volley.ByJsonRequest;
import com.itboye.jinpuyiyuan.utils.volley.ICompleteListener;

import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/12/14 0014.
 */
public class BranchAddressResponsitory extends BaseNetRepository implements ISelectBranch<BranchBean> {

    private String api = "100";//接口版本号
    private String api1="101";
    private String api3="103";

    private String config = "By_Config_app";// 获取配置
    private String loginByWX="By_Weixin_loginApp";//微信登录
    private String addRemark="By_UserTags_add";//添加标签
    private String removeRemark="By_UserTags_delete";//删除标签
    private String queryRemark="By_UserTags_query";//查询标签
    private String queryOnline="By_UserProfile_getOnlineStatus";//查询用户在线状态
    private String synInfo="By_Alibaichuan_sync";//同步用户信息
    private String aliInfo="By_Alibaichuan_info";//查询用户信息
    private String vip="By_UserGrade_info";//会员等级
    private String banner="By_Banners_query";//轮播
    private String getVerifyCode="By_SecurityCode_create";//获取验证码
    private String verificationVerifyCode="By_SecurityCode_check";//验证验证码
    private String updatePass="By_UserAccount_updatePwdByOldPwd";//修改密码（无验证码）
    private String updatePassword="By_UserAccount_updatePwdByMobileCode";//修改密码（有验证码）
    private String register="By_UserAccount_register";//注册
    private String loginBySign="By_UserAccount_loginByUsername";//登录（用户名+密码）
    private String outLogin="By_UserAccount_logout";//退出登录
    private String login="By_UserAccount_loginByMobile";//登录(国家区号+手机号+密码+验证码)
    private String suggest="By_Suggest_add";//意见反馈

    private String articleDetail="By_Post_info";//文章详情
    private String queryArticle="By_Post_queryByCateOrTag";//文章查询

    private String queryMessage="By_Message_query";//消息查询

    private String postLike="By_Post_like";//点赞


    private String getUserInfo="By_UserIdCard_info";//获取用户信息
    private String updateUserInfo="By_UserIdCard_update";//用户身份信息更新
    private String updateLocation="By_UserProfile_updateGeoHash";//用户GPS位置更新
    private String updateUserPrefile="By_UserProfile_update";//用户更新

    private String branch = "By_Hosp_query";// 分院查询
    private String department = "By_HospSect_query";// 分院科室查询
    private String queryDoctor="By_HospDoct_query";//医师查询
    private String queryDoctorDetail="By_HospDoct_detail";//医师详情

    public BranchAddressResponsitory(ICompleteListener iCompleteListener) {
        super(iCompleteListener);
    }

    @Override
    public void deleteCacheConfig(String nope) {

    }

    @Override
    public void getConfig() {
        Type type = new TypeToken<ConfigBean>() {
        }.getType();
        String apiVer = api;
        Map<String, Object> map = new HashMap<>();
        map.put("app_type","android");
        (new ByJsonRequest.Builder<ConfigBean>())
                .setTypeVerParamsAndReturnClass(config, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<ConfigBean>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }

    @Override
    public void queryBranch(long longitude, long latitude) {
        Type type = new TypeToken<BranchBean>() {
        }.getType();
        String apiVer = api;
        Map<String, Object> map = new HashMap<>();
//        map.put("dt_type", dt_type);
        map.put("long","");
        map.put("lati","");
        (new ByJsonRequest.Builder<BranchBean>())
                .setTypeVerParamsAndReturnClass(branch, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<BranchBean>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }

    @Override
    public void queryDepartment(int hid) {
        Type type = new TypeToken<List<BranchDepartmentBean>>() {
        }.getType();
        String apiVer = api;
        Map<String, Object> map = new HashMap<>();
        map.put("hid",hid);
        (new ByJsonRequest.Builder<List<BranchDepartmentBean>>())
                .setTypeVerParamsAndReturnClass(department, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<List<BranchDepartmentBean>>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();

    }

    @Override
    public void getVerifyCode(String accepter, int code_type, int code_length, int code_create_way, int expire_time) {
        Type type = new TypeToken<String>() {
        }.getType();
        String apiVer = api;
        Map<String, Object> map = new HashMap<>();
//        map.put("dt_type", dt_type);
        map.put("accepter",accepter);
        map.put("code_type",code_type);
        map.put("code_length",code_length);
        map.put("code_create_way",code_create_way);
        map.put("expire_time",expire_time);
        (new ByJsonRequest.Builder<String>())
                .setTypeVerParamsAndReturnClass(getVerifyCode, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<String>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }

    @Override
    public void verificationVerifyCode(String accepter, String code, int code_type) {
        Type type = new TypeToken<String>() {
        }.getType();
        String apiVer = api;
        Map<String, Object> map = new HashMap<>();
//        map.put("dt_type", dt_type);
        map.put("accepter",accepter);
        map.put("code",code);
        map.put("code_type",code_type);
        (new ByJsonRequest.Builder<String>())
                .setTypeVerParamsAndReturnClass(verificationVerifyCode, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<String>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }


    @Override
    public void updatePass(String uid, String password, String new_password) {
        Type type = new TypeToken<String>() {
        }.getType();
        String apiVer = api1;
        Map<String, Object> map = new HashMap<>();
//        map.put("dt_type", dt_type);
        map.put("uid",uid);
        map.put("password",password);
        map.put("new_password",new_password);
        (new ByJsonRequest.Builder<String>())
                .setTypeVerParamsAndReturnClass(updatePass, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<String>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }

    @Override
    public void register(String username, String mobile, String code, String password) {
        Type type = new TypeToken<String>() {
        }.getType();
        String apiVer = api;
        Map<String, Object> map = new HashMap<>();
//        map.put("dt_type", dt_type);
        map.put("username",username);
        map.put("country_no","+86");
        map.put("mobile",mobile);
        map.put("code","itboye");
        map.put("password",password);
        (new ByJsonRequest.Builder<String>())
                .setTypeVerParamsAndReturnClass(register, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<String>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }


    @Override
    public void login(String nickname,String head,String wx_open_id,String wx_union_id,String mobile, String code, String password, String role) {
        Type type = new TypeToken<PersonBean>() {
        }.getType();
        String apiVer = api3;
        Map<String, Object> map = new HashMap<>();
//        map.put("dt_type", dt_type);
        map.put("nickname",nickname);
        map.put("head",head);
        map.put("wx_open_id",wx_open_id);
        map.put("wx_union_id",wx_union_id);
        map.put("country_no","+86");
        map.put("mobile",mobile);
        map.put("code",code);
        map.put("password",password);
        map.put("role",role);
        map.put("device_token","device_token");
        map.put("device_type","android");

        (new ByJsonRequest.Builder<PersonBean>())
                .setTypeVerParamsAndReturnClass(login, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<PersonBean>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }

    @Override
    public void outLogin(String uid, String session_id) {
        Type type = new TypeToken<String>() {
        }.getType();
        String apiVer = api1;
        Map<String, Object> map = new HashMap<>();
//        map.put("dt_type", dt_type);
        map.put("uid",uid);
        map.put("session_id",session_id);
        (new ByJsonRequest.Builder<String>())
                .setTypeVerParamsAndReturnClass(outLogin, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<String>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }

    @Override
    public void deleteUser(String uid) {

    }

    @Override
    public void forgetPassword(String mobile, String code, String new_password) {
        Type type = new TypeToken<String>() {
        }.getType();
        String apiVer = api1;
        Map<String, Object> map = new HashMap<>();
//        map.put("dt_type", dt_type);
        map.put("country_no","+86");
        map.put("mobile",mobile);
//        map.put("code",code);
        map.put("code","itboye");
        map.put("new_password",new_password);
        (new ByJsonRequest.Builder<String>())
                .setTypeVerParamsAndReturnClass(updatePassword, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<String>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }

    @Override
    public void resetPassword(String uid, String password, String new_password) {

        Type type = new TypeToken<String>() {
        }.getType();
        String apiVer = api1;
        Map<String, Object> map = new HashMap<>();
//        map.put("dt_type", dt_type);
        map.put("uid",uid);
        map.put("password",password);
//        map.put("code",code);
        map.put("new_password",new_password);
        (new ByJsonRequest.Builder<String>())
                .setTypeVerParamsAndReturnClass(updatePass, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<String>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }


    @Override
    public void suggestContent(String uid, String name, String suggest_content
            , String tel, String email, String img_ids, String extra) {
        Type type = new TypeToken<String>() {
        }.getType();
        String apiVer = api;
        Map<String, Object> map = new HashMap<>();
//        map.put("dt_type", dt_type);
        map.put("uid",uid);
        map.put("name",name);
        map.put("suggest_content",suggest_content);
        map.put("tel",tel);
        map.put("email","email");
        map.put("img_ids","img_ids");
        map.put("extra","extra");

        (new ByJsonRequest.Builder<String>())
                .setTypeVerParamsAndReturnClass(suggest, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<String>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();

    }

    @Override
    public void getPersonInfo(String uid) {
        Type type = new TypeToken<UserInfoBean>() {
        }.getType();
        String apiVer = api1;
        Map<String, Object> map = new HashMap<>();
//        map.put("dt_type", dt_type);
        map.put("uid",uid);

        (new ByJsonRequest.Builder<UserInfoBean>())
                .setTypeVerParamsAndReturnClass(getUserInfo, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<UserInfoBean>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }

    @Override
    public void updatePersonInfo(String uid, String card_no, String real_name) {
        Type type = new TypeToken<String>() {
        }.getType();
        String apiVer = api1;
        Map<String, Object> map = new HashMap<>();
//        map.put("dt_type", dt_type);
        map.put("uid",uid);
        map.put("card_no",card_no);
        map.put("real_name",real_name);

        (new ByJsonRequest.Builder<String>())
                .setTypeVerParamsAndReturnClass(updateUserInfo, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<String>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();

    }

    @Override
    public void updateLocation(String uid, String lat, String lng, String coordinate_type) {

        Type type = new TypeToken<String>() {
        }.getType();
        String apiVer = api1;
        Map<String, Object> map = new HashMap<>();
//        map.put("dt_type", dt_type);
        map.put("uid",uid);
        map.put("lat",lat);
        map.put("lng",lng);
        map.put("coordinate_type","bd09");
        (new ByJsonRequest.Builder<String>())
                .setTypeVerParamsAndReturnClass(updateLocation, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<String>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }

    @Override
    public void updateUserProfile(String uid, String nickname, String sign, int sex, String realname,
                                  String idnumber, int online_status) {
        Type type = new TypeToken<String>() {
        }.getType();
        String apiVer = api1;
        Map<String, Object> map = new HashMap<>();
//        map.put("uid",uid);
//        map.put("nickname",nickname);
//        map.put("sign",sign);
//        map.put("sex",sex);
//        map.put("realname",realname);
//        map.put("idnumber",idnumber);
//        map.put("login_device_cnt",login_device_cnt);
//        map.put("birthday",birthday);
//        map.put("hometown",hometown);
//        map.put("nation",nation);
//        map.put("profession",profession);
//        map.put("works_cate",works_cate);
//        map.put("working_years",working_years);
//        map.put("online_status",online_status);

        map.put("uid",uid);
        map.put("nickname",nickname);
        map.put("sign",sign);
        map.put("sex",sex);
        map.put("realname",realname);
        map.put("idnumber",idnumber);
        map.put("login_device_cnt",3);
        map.put("birthday",0);
        map.put("hometown","");
        map.put("nation","");
        map.put("profession","");
        map.put("works_cate","");
        map.put("working_years",10);
        map.put("online_status",online_status);

        (new ByJsonRequest.Builder<String>())
                .setTypeVerParamsAndReturnClass(updateUserPrefile, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<String>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }

    @Override
    public void queryDoctor(String uid, String hid, String cid,int doct_type) {
        Type type = new TypeToken<QueryDoctorListBean>() {
        }.getType();
        String apiVer = api;
        Map<String, Object> map = new HashMap<>();
        map.put("uid",uid);
        map.put("hid",hid);
        map.put("cid",cid);
        map.put("doct_type",doct_type);
        map.put("page_index","1");
        map.put("page_size","10");
        (new ByJsonRequest.Builder<QueryDoctorListBean>())
                .setTypeVerParamsAndReturnClass(queryDoctor, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<QueryDoctorListBean>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }

    @Override
    public void queryDoctorDetail(String uid) {
        Type type = new TypeToken<RegisterDoctorDetail>() {
        }.getType();
        String apiVer = api;
        Map<String, Object> map = new HashMap<>();
        map.put("uid",uid);
        (new ByJsonRequest.Builder<RegisterDoctorDetail>())
                .setTypeVerParamsAndReturnClass(queryDoctorDetail, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<RegisterDoctorDetail>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }

    @Override
    public void postLike(String id, String uid, int cancel) {
        Type type = new TypeToken<String>() {
        }.getType();
        String apiVer = api;
        Map<String, Object> map = new HashMap<>();
        map.put("id",id);
        map.put("uid",uid);
        map.put("cancel",cancel);
        (new ByJsonRequest.Builder<String>())
                .setTypeVerParamsAndReturnClass(postLike, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<String>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }

    @Override
    public void articleDetail(String id) {

        Type type = new TypeToken<ArticleDetailBean>() {
        }.getType();
        String apiVer = api;
        Map<String, Object> map = new HashMap<>();
        map.put("id",id);
        (new ByJsonRequest.Builder<List<NoticeBean>>())
                .setTypeVerParamsAndReturnClass(articleDetail, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<List<NoticeBean>>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }

    @Override
    public void addArticle(String category, String author, String author_name, String cover, String title, String excerpt, String content, String tags, String post_status, String parent_id, String jump_url, int views, String article_from, int likes) {

    }

    @Override
    public void updateArticle(String category, String author, String author_name, String cover, String title, String excerpt, String content, String tags, String post_status, String parent_id, String jump_url, int views, String article_from, int likes) {

    }

    @Override
    public void queryArticle(String category, String tags, String post_status,int page_index,int page_size) {

        Type type = new TypeToken<List<ArticleListBean>>() {
        }.getType();
        String apiVer = api1;
        Map<String, Object> map = new HashMap<>();
        map.put("category",category);
        map.put("tags",tags);
        map.put("post_status",post_status);
        map.put("page_index",page_index);
        map.put("page_size",page_size);

        (new ByJsonRequest.Builder<List<NoticeBean>>())
                .setTypeVerParamsAndReturnClass(queryArticle, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<List<NoticeBean>>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }

    @Override
    public void deleteArticle(String id) {

    }

    @Override
    public void addMessage(String dtree_type, String title, String content, String summary, int send_time, String from_uid, String to_uid, String extra) {

    }

    @Override
    public void queryMessage(String uid, String msg_type, int page_index, int page_size) {
        Type type = new TypeToken<List<NoticeBean>>() {
        }.getType();
        String apiVer = api;
        Map<String, Object> map = new HashMap<>();
        map.put("uid",uid);
        map.put("msg_type",msg_type);
        map.put("page_index",page_index);
        map.put("page_size",page_size);
        (new ByJsonRequest.Builder<List<NoticeBean>>())
                .setTypeVerParamsAndReturnClass(queryMessage, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<List<NoticeBean>>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }



    @Override
    public void queryBanner(String position) {
        Type type = new TypeToken<List<BannerBean>>() {
        }.getType();
        String apiVer = api;
        Map<String, Object> map = new HashMap<>();
        map.put("position",position);
        map.put("---- ","");
        (new ByJsonRequest.Builder<List<BannerBean>>())
                .setTypeVerParamsAndReturnClass(banner, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<List<BannerBean>>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }

    @Override
    public void memberGrade(String uid) {
        Type type = new TypeToken<List<VipBean>>() {
        }.getType();
        String apiVer = api;
        Map<String, Object> map = new HashMap<>();
        map.put("uid",uid);
        (new ByJsonRequest.Builder<List<VipBean>>())
                .setTypeVerParamsAndReturnClass(vip, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<List<VipBean>>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }

    @Override
    public void queryRegion(String uid) {

    }

    @Override
    public void queryPersonInfo(String openId) {

        Type type = new TypeToken<ALIInfoBean>() {
        }.getType();
        String apiVer = api;
        Map<String, Object> map = new HashMap<>();
        map.put("open_id",openId);
        (new ByJsonRequest.Builder<ALIInfoBean>())
                .setTypeVerParamsAndReturnClass(aliInfo, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<ALIInfoBean>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }

    @Override
    public void synPersonInfo(String uid) {

        Type type = new TypeToken<String>() {
        }.getType();
        String apiVer = api;
        Map<String, Object> map = new HashMap<>();
        map.put("uid",uid);
        (new ByJsonRequest.Builder<String>())
                .setTypeVerParamsAndReturnClass(synInfo, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<String>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }

    @Override
    public void addRemark(String uid,String tag_name,String who_tag_uid ) {
        Type type = new TypeToken<String>() {
        }.getType();
        String apiVer = api;
        Map<String, Object> map = new HashMap<>();
        map.put("uid",uid);
        map.put("tag_name",tag_name);
        map.put("who_tag_uid",who_tag_uid);
        (new ByJsonRequest.Builder<String>())
                .setTypeVerParamsAndReturnClass(addRemark, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<String>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();

    }

    @Override
    public void removeRemark(int id) {
        Type type = new TypeToken<String>() {
        }.getType();
        String apiVer = api;
        Map<String, Object> map = new HashMap<>();
        map.put("id",id);
        (new ByJsonRequest.Builder<String>())
                .setTypeVerParamsAndReturnClass(removeRemark, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<String>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }

    @Override
    public void queryRemark(int uid) {
        Type type = new TypeToken<List<IllTagBean>>() {
        }.getType();
        String apiVer = api;
        Map<String, Object> map = new HashMap<>();
        map.put("uid",uid);
        (new ByJsonRequest.Builder<List<IllTagBean>>())
                .setTypeVerParamsAndReturnClass(queryRemark, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<List<IllTagBean>>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }

    @Override
    public void queryOnlineStatus(String bc_open_id) {
        Type type = new TypeToken<OnlineBean>() {
        }.getType();
        String apiVer = api1;
        Map<String, Object> map = new HashMap<>();
        map.put("bc_open_id",bc_open_id);
        (new ByJsonRequest.Builder<OnlineBean>())
                .setTypeVerParamsAndReturnClass(queryOnline, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<OnlineBean>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }

    @Override
    public void loginByWX(String role, String device_token, String auth_code) {

        Type type = new TypeToken<PersonBean>() {
        }.getType();
        String apiVer = api;
        Map<String, Object> map = new HashMap<>();
        map.put("role",role);
        map.put("device_token",device_token);
        map.put("device_type","android");
        map.put("auth_code",auth_code);
        (new ByJsonRequest.Builder<PersonBean>())
                .setTypeVerParamsAndReturnClass(loginByWX, apiVer, map, type)
                .requestListener(
                        new BaseSuccessReqListener<PersonBean>(
                                getListener()))
                .errorListener(new BaseErrorListener(getListener()))
                .desEncodeThenBuildAndSend();
    }
}
